import request from '@/utils/request'
//应用管理列表
export function listLication(query) {
    return request({
        url: '/apisecurity/applicationManage/list',
        method: 'get',
        params: query
    })
}
//应用管理查询
export function getInfoLication(id) {
    return request({
        url: '/apisecurity/applicationManage/getInfo',
        method: 'get',
        params: id
    })
}
//应用管理增加
export function addLication(data) {
    return request({
        url: '/apisecurity/applicationManage/add',
        method: 'post',
        data
    })
}
//应用管理编辑
export function editLication(data) {
    return request({
        url: '/apisecurity/applicationManage/edit',
        method: 'post',
        data
    })
}
//应用管理删除
export function deleteLication(data) {
    return request({
        url: '/apisecurity/applicationManage/delete',
        method: 'post',
        data
    })
}

//删除服务名等字段时查询是否被调用
export function getApplicationServer(data) {
    return request({
        url: '/apisecurity/applicationManage/getApplicationServer',
        method: 'get',
        params: data
    })
}
export function getApplication(data) {
    return request({
        url: '/apisecurity/applicationManage/getApplication',
        method: 'post',
        data
    })
}

// 资产拓扑图
export function getTopologyById(params) {
  return request({
    url: '/apisecurity/applicationManage/selectTreeById',
    method: 'get',
    params
  })
}

export function updateSwitch(data) {
    return request({
        url: '/apisecurity/applicationManage/updateSwitch',
        method: 'post',
        data
    })
}

//分配组织
export function updateDeptId(data) {
    return request({
        url: '/apisecurity/applicationManage/updateDeptId',
        method: 'post',
        data
    })
}